#ifndef __ACCEPTOR_HPP__
#define __ACCEPTOR_HPP__
#include "Socket.hpp"
#include "InetAddress.hpp"
#include <string>



namespace wd
{
using std::string;

class Acceptor
{
public:
    Acceptor(const string &,unsigned short);

    void ready();
    int accept();
    int getFd()const;

private:
    void bind();
    void listen();
    void setAddrReuse();
    void setPortReuse();

private:
    Socket _socket;
    InetAddress _address;
};

}//end of namespace



#endif // __ACCEPTOR_HPP__

